import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root'
})
export class PromotionIncomeManageService {

  serivceUrls = {
    queryGameListUrl: '/gameApp/list', // 查询应用列表
    queryRechargeConsumptionUrl: '/userBillRecord/page', // 查询充值 | 消费记录
    exportRechargeConsumptionUrl: '/userBillRecord/findExcel', // 充值 | 消费 导出
  };

  constructor(public httpClient: HttpClient) { }

  // 查询应用列表
  getGameList(params: any) {
    return this.httpClient.post(this.serivceUrls.queryGameListUrl, params).toPromise();
  }

  // 查询充值 | 消费记录
  getRechargeConsumptionList(params: any) {
    return this.httpClient.post(this.serivceUrls.queryRechargeConsumptionUrl, params).toPromise();
  }

  // 充值 | 消费 导出
  exportRechargeConsumption(params: any) {
    return this.httpClient.get(this.serivceUrls.exportRechargeConsumptionUrl, { params, responseType: 'blob' }).toPromise();
  }
}

